home *** CD-ROM | disk | FTP | other *** search
/ Champak 138 / Volume 138 Aug 19 2011 - Damaged.iso / Games / shadez.swf / scripts / Local / Game / HUD / CHUDData.as < prev    next >
Encoding:
Text File  |  2011-08-19  |  14.7 KB  |  323 lines

  1. package Local.Game.HUD
  2. {
  3.    import Local.*;
  4.    import Local.Game.Level.*;
  5.    import Local.Game.Thing.*;
  6.    import Local.Game.World.*;
  7.    import Local.Game.World.Map.*;
  8.    import Local.Game.World.Map.Cell.*;
  9.    import STC9.IO.*;
  10.    import STC9.System.*;
  11.    import flash.display.*;
  12.    import flash.events.*;
  13.    import flash.filters.*;
  14.    import flash.geom.*;
  15.    import flash.text.*;
  16.    
  17.    public class CHUDData
  18.    {
  19.       
  20.       public static const SECONDS:int;
  21.       
  22.       {
  23.          if(true)
  24.          {
  25.             SECONDS = CThingBase.SECONDS;
  26.          }
  27.       }
  28.       
  29.       private var mHUD:CHUD;
  30.       
  31.       public function CHUDData(param1:CHUD)
  32.       {
  33.          super();
  34.          mHUD = param1;
  35.       }
  36.       
  37.       public function e_RDCOMPLETE_CLUSTER(param1:Event = null) : void
  38.       {
  39.          ActivateRDIcon(CHUDIcon(param1.currentTarget),"strikes",["clusterbomb"]);
  40.       }
  41.       
  42.       public function InitPanel_Upgrades(param1:CHUDPanel) : void
  43.       {
  44.          var _loc2_:CHUDIcon = null;
  45.          param1.AddIcon(_loc2_ = new CHUDIcon("rdtomahawk",new Icon_RD_Tomahawk(),"rd",true,5 * SECONDS,1,100000));
  46.          if(true)
  47.          {
  48.             _loc2_.mDesc_Normal = "Click to add the Tomahawk Missile to your arsenal. Good for precision on ground targets. (CTRL-Click to cancel)";
  49.             _loc2_.addEventListener(CHUDIcon.RDCOMPLETE,e_RDCOMPLETE_TOMAHAWK);
  50.          }
  51.          param1.AddIcon(_loc2_ = new CHUDIcon("rdpatriot",new Icon_RD_Patriot(),"rd",true,5 * SECONDS,1,150000));
  52.          if(true)
  53.          {
  54.             _loc2_.mDesc_Normal = "Click to add the Patriot Missile to your arsenal. Good for precision on airbourne targets. (CTRL-Click to cancel)";
  55.             _loc2_.addEventListener(CHUDIcon.RDCOMPLETE,e_RDCOMPLETE_PATRIOT);
  56.          }
  57.          param1.AddIcon(_loc2_ = new CHUDIcon("rdtankm1a1",new Icon_RD_TankM1A1(),"rd",true,5 * SECONDS,1,200000));
  58.          if(true)
  59.          {
  60.             _loc2_.mDesc_Normal = "Click to add the M1A1 Abrams Battle tank to your arsenal. Good for defensive front lines. (CTRL-Click to cancel)";
  61.             _loc2_.addEventListener(CHUDIcon.RDCOMPLETE,e_RDCOMPLETE_TANKM1A1);
  62.          }
  63.          param1.AddIcon(_loc2_ = new CHUDIcon("rdartillery",new Icon_RD_Artillery(),"rd",true,10 * SECONDS,1,250000));
  64.          _loc2_.mDesc_Normal = "Click to add the Artillery strike to your arsenal. Great for stopping the enemy progressing beyond a ground location. (CTRL-Click to cancel)";
  65.          _loc2_.addEventListener(CHUDIcon.RDCOMPLETE,e_RDCOMPLETE_ARTILLERY);
  66.          param1.AddIcon(_loc2_ = new CHUDIcon("rdapache",new Icon_RD_Apache(),"rd",true,10 * SECONDS,1,500000));
  67.          _loc2_.mDesc_Normal = "Click to add the Apache Attack Helicopter to your arsenal. Great for stopping the enemy progressing beyond an air/ground location. (CTRL-Click to cancel)";
  68.          _loc2_.addEventListener(CHUDIcon.RDCOMPLETE,e_RDCOMPLETE_APACHE);
  69.          param1.AddIcon(_loc2_ = new CHUDIcon("rdchinook",new Icon_RD_Chinook(),"rd",true,10 * SECONDS,1,700000));
  70.          if(true)
  71.          {
  72.             _loc2_.mDesc_Normal = "Click to add the Chinook Transport Helicopter to your arsenal. Great for bringing Tanks and Troops to the front line. (CTRL-Click to cancel)";
  73.             _loc2_.addEventListener(CHUDIcon.RDCOMPLETE,e_RDCOMPLETE_CHINOOK);
  74.          }
  75.          param1.AddIcon(_loc2_ = new CHUDIcon("rdcluster",new Icon_RD_ClusterBomb(),"rd",true,10 * SECONDS,1,1000000));
  76.          if(true)
  77.          {
  78.             _loc2_.mDesc_Normal = "Click to add the Cluster Bomb strike to your arsenal. Great for removing enemies in the line of progression. (CTRL-Click to cancel)";
  79.             _loc2_.addEventListener(CHUDIcon.RDCOMPLETE,e_RDCOMPLETE_CLUSTER);
  80.          }
  81.          param1.AddIcon(_loc2_ = new CHUDIcon("rdairbomb",new Icon_RD_AirBomb(),"rd",true,10 * SECONDS,1,2000000));
  82.          _loc2_.mDesc_Normal = "Click to add the Air Bomb strike to your arsenal. Removes all Air/Ground enemy units from any location on the Battlefield. (CTRL-Click to cancel)";
  83.          _loc2_.addEventListener(CHUDIcon.RDCOMPLETE,e_RDCOMPLETE_AIRBOMB);
  84.       }
  85.       
  86.       public function InitPanel_Units(param1:CHUDPanel) : void
  87.       {
  88.          var _loc2_:CHUDIcon = null;
  89.          param1.AddIcon(_loc2_ = new CHUDIcon("m16",new Icon_M16(),"spawn",true,1 * SECONDS,9,1000));
  90.          if(true)
  91.          {
  92.             _loc2_.mDesc_Normal = "Click to build a Special ops troop. Highly trained and willing to die to win the war. (CTRL-Click to cancel)";
  93.          }
  94.          param1.AddIcon(_loc2_ = new CHUDIcon("tankm1a1",new Icon_TankM1A1(),"spawn",false,4 * SECONDS,9,10000));
  95.          if(true)
  96.          {
  97.             _loc2_.mDesc_Normal = "Click to build a M1A1 Abrams Battle tank. Good at creating defensive lines and stopping the enemy\'s progression. (CTRL-Click to cancel)";
  98.          }
  99.          param1.AddIcon(_loc2_ = new CHUDIcon("apache",new Icon_Apache(),"spawn",false,7 * SECONDS,9,25000));
  100.          _loc2_.mDesc_Normal = "Click to build an Apache Attack Helicopter. Great at targetting ground and air units. (CTRL-Click to cancel)";
  101.          param1.AddIcon(_loc2_ = new CHUDIcon("chinooktroop",new Icon_ChinookTroop(),"spawn",false,8 * SECONDS,9,20000));
  102.          _loc2_.mDesc_Normal = "Click to build a Chinook Transport Helicopter and bring troops to a precise location on the battlefield. (CTRL-Click to cancel)";
  103.          param1.AddIcon(_loc2_ = new CHUDIcon("chinooktank",new Icon_ChinookTank(),"spawn",false,6 * SECONDS,9,20000));
  104.          _loc2_.mDesc_Normal = "Click to build a Chinook Transport Helicopter and bring a tank to a precise location on the battlefield. (CTRL-Click to cancel)";
  105.       }
  106.       
  107.       public function e_RDCOMPLETE_PATRIOT(param1:Event = null) : void
  108.       {
  109.          ActivateRDIcon(CHUDIcon(param1.currentTarget),"strikes",["patriotmissile"]);
  110.       }
  111.       
  112.       public function e_RDCOMPLETE_APACHE(param1:Event = null) : void
  113.       {
  114.          ActivateRDIcon(CHUDIcon(param1.currentTarget),"units",["apache"]);
  115.       }
  116.       
  117.       public function InitPanel_Map(param1:CHUDPanel) : void
  118.       {
  119.       }
  120.       
  121.       public function e_RDCOMPLETE_ARTILLERY(param1:Event = null) : void
  122.       {
  123.          if(true)
  124.          {
  125.             ActivateRDIcon(CHUDIcon(param1.currentTarget),"strikes",["artillery"]);
  126.          }
  127.       }
  128.       
  129.       public function e_LAUNCH_PATRIOT(param1:Event = null) : void
  130.       {
  131.          var _loc2_:CHUD = null;
  132.          var _loc3_:CThingMain = null;
  133.          _loc2_ = CHUDIcon(param1.currentTarget).mHUD;
  134.          _loc2_.mLevel.AddFriend(_loc3_ = new CShotPatriot(new CPosition(0,0)));
  135.       }
  136.       
  137.       public function e_LAUNCH_TOMAHAWK(param1:Event = null) : void
  138.       {
  139.          var _loc2_:CHUD = null;
  140.          var _loc3_:CThingMain = null;
  141.          _loc2_ = CHUDIcon(param1.currentTarget).mHUD;
  142.          ┬º┬ºpush(_loc2_.mLevel);
  143.          ┬º┬ºpush(┬º┬ºfindproperty(CShotTomahawk));
  144.          ┬º┬ºpush(new CPosition(0,0));
  145.          ┬º┬ºpush(_loc2_.mMouse);
  146.          if(true)
  147.          {
  148.             ┬º┬ºpop().AddFriend(_loc3_ = new ┬º┬ºpop().CShotTomahawk(┬º┬ºpop(),!!┬º┬ºpop().mClickThing ? _loc2_.mMouse.mClickThing : _loc2_.mMouse.mClickPosition),0,false);
  149.             if(true)
  150.             {
  151.                ┬º┬ºpush(_loc2_.mMouse);
  152.                if(true)
  153.                {
  154.                   ┬º┬ºgoto(addr89);
  155.                }
  156.                ┬º┬ºpop().mClickThing.SelectionFlash_Init();
  157.             }
  158.             addr89:
  159.             if(┬º┬ºpop().mClickThing)
  160.             {
  161.                if(true)
  162.                {
  163.                   _loc2_.AddTarget(_loc2_.mMouse.mClickThing,_loc3_);
  164.                }
  165.                ┬º┬ºpush(_loc2_.mMouse);
  166.             }
  167.             return;
  168.          }
  169.          ┬º┬ºgoto(addr50);
  170.       }
  171.       
  172.       public function e_LAUNCH_CLUSTERBOMB(param1:Event = null) : void
  173.       {
  174.          var _loc2_:CHUD = null;
  175.          var _loc3_:CThingMain = null;
  176.          _loc2_ = CHUDIcon(param1.currentTarget).mHUD;
  177.          ┬º┬ºpush(_loc2_.mLevel);
  178.          ┬º┬ºpush(┬º┬ºfindproperty(CStrikeClusterBomb));
  179.          ┬º┬ºpush(_loc2_.mMouse);
  180.          if(true)
  181.          {
  182.             ┬º┬ºpop().AddFriend(_loc3_ = new ┬º┬ºpop().CStrikeClusterBomb(!!┬º┬ºpop().mClickThing ? _loc2_.mMouse.mClickThing : _loc2_.mMouse.mClickPosition),0,false);
  183.             if(true)
  184.             {
  185.                ┬º┬ºpush(_loc2_.mMouse);
  186.                if(true)
  187.                {
  188.                   ┬º┬ºgoto(addr85);
  189.                }
  190.                ┬º┬ºpop().mClickThing.SelectionFlash_Init();
  191.             }
  192.             addr85:
  193.             if(┬º┬ºpop().mClickThing)
  194.             {
  195.                if(true)
  196.                {
  197.                   _loc2_.AddTarget(_loc2_.mMouse.mClickThing,_loc3_);
  198.                }
  199.                ┬º┬ºpush(_loc2_.mMouse);
  200.             }
  201.             return;
  202.          }
  203.          ┬º┬ºgoto(addr46);
  204.       }
  205.       
  206.       public function e_RDCOMPLETE_AIRBOMB(param1:Event = null) : void
  207.       {
  208.          if(true)
  209.          {
  210.             ActivateRDIcon(CHUDIcon(param1.currentTarget),"strikes",["airbomb"]);
  211.          }
  212.       }
  213.       
  214.       public function InitPanel_Strikes(param1:CHUDPanel) : void
  215.       {
  216.          var _loc2_:CHUDIcon = null;
  217.          param1.AddIcon(_loc2_ = new CHUDIcon("tomahawkmissile",new Icon_TomahawkMissile(),"launch",false,2 * SECONDS,1,20000,"strikeLG"));
  218.          _loc2_.addEventListener(CHUDIcon.LAUNCH,e_LAUNCH_TOMAHAWK);
  219.          _loc2_.mDesc_Normal = "Click to build the Tomahawk missile. This missile will lock on to all Ground targets. (CTRL-Click to cancel)";
  220.          _loc2_.mDesc_Launch = "The Tomahawk missile is ready to launch, click to allow target allocation.";
  221.          _loc2_.mDesc_LaunchSelected = "Either click on a ground target or launch to a location on the battlefield. (ESC to cancel)";
  222.          param1.AddIcon(_loc2_ = new CHUDIcon("patriotmissile",new Icon_PatriotMissile(),"launch",false,2 * SECONDS,1,30000,"strikeLA"));
  223.          _loc2_.addEventListener(CHUDIcon.LAUNCH,e_LAUNCH_PATRIOT);
  224.          _loc2_.mDesc_Normal = "Click to build the Patriot missile. This missile will lock on to all Airbourne targets. (CTRL-Click to cancel)";
  225.          _loc2_.mDesc_Launch = "The Patriot missile is ready to launch, click to allow target allocation.";
  226.          _loc2_.mDesc_LaunchSelected = "No need to select a target as the Patriot will find and hunt down the closest Aribourne target. (ESC to cancel)";
  227.          param1.AddIcon(_loc2_ = new CHUDIcon("artillery",new Icon_Artillery(),"launch",false,5 * SECONDS,1,100000,"strikeLG"));
  228.          _loc2_.addEventListener(CHUDIcon.LAUNCH,e_LAUNCH_ARTILLERY);
  229.          _loc2_.mDesc_Normal = "Click to order an Artillery strike. Battleships are waiting by to launch a precision strike. (CTRL-Click to cancel)";
  230.          _loc2_.mDesc_Launch = "The Artillery strike is now ready to launch, click to allow target allocation.";
  231.          _loc2_.mDesc_LaunchSelected = "Either click on a ground target or launch to a location on the battlefield. (ESC to cancel)";
  232.          param1.AddIcon(_loc2_ = new CHUDIcon("clusterbomb",new Icon_ClusterBomb(),"launch",false,10 * SECONDS,1,250000,"strikeLG"));
  233.          _loc2_.addEventListener(CHUDIcon.LAUNCH,e_LAUNCH_CLUSTERBOMB);
  234.          _loc2_.mDesc_Normal = "Click to order a Cluster Bomb strike. An F-15 Eagle is standing by to clear an area on the battlefield. (CTRL-Click to cancel)";
  235.          _loc2_.mDesc_Launch = "The F-15 Eagle is now airbourne and ready to strike, click to allow target allocation.";
  236.          _loc2_.mDesc_LaunchSelected = "Either click on a ground target or launch to a location on the battlefield. (ESC to cancel)";
  237.          param1.AddIcon(_loc2_ = new CHUDIcon("airbomb",new Icon_AirBomb(),"launch",false,20 * SECONDS,1,500000,"strikeLG"));
  238.          if(true)
  239.          {
  240.             _loc2_.addEventListener(CHUDIcon.LAUNCH,e_LAUNCH_AIRBOMB);
  241.             if(true)
  242.             {
  243.                _loc2_.mDesc_Normal = "Click to order an Airbomb. B-2 Stealth bombers are standing by to devastate the enemy. (CTRL-Click to cancel)";
  244.                _loc2_.mDesc_Launch = "B-2 Stealth bombers are now airbourne and ready to strike, click to allow target allocation.";
  245.             }
  246.             _loc2_.mDesc_LaunchSelected = "Either click on a ground target or launch to a location on the battlefield. (ESC to cancel)";
  247.          }
  248.       }
  249.       
  250.       public function e_RDCOMPLETE_TANKM1A1(param1:Event = null) : void
  251.       {
  252.          if(true)
  253.          {
  254.             ActivateRDIcon(CHUDIcon(param1.currentTarget),"units",["tankm1a1"]);
  255.          }
  256.       }
  257.       
  258.       public function e_LAUNCH_AIRBOMB(param1:Event = null) : void
  259.       {
  260.          var _loc2_:CHUD = null;
  261.          var _loc3_:CThingMain = null;
  262.          _loc2_ = CHUDIcon(param1.currentTarget).mHUD;
  263.          _loc2_.mLevel.AddFriend(_loc3_ = new CStrikeAirBomb(!!_loc2_.mMouse.mClickThing ? _loc2_.mMouse.mClickThing : _loc2_.mMouse.mClickPosition),0,false);
  264.          if(_loc2_.mMouse.mClickThing)
  265.          {
  266.             _loc2_.AddTarget(_loc2_.mMouse.mClickThing,_loc3_);
  267.             _loc2_.mMouse.mClickThing.SelectionFlash_Init();
  268.          }
  269.       }
  270.       
  271.       public function e_LAUNCH_ARTILLERY(param1:Event = null) : void
  272.       {
  273.          var _loc2_:CHUD = null;
  274.          var _loc3_:CThingMain = null;
  275.          _loc2_ = CHUDIcon(param1.currentTarget).mHUD;
  276.          _loc2_.mLevel.AddFriend(_loc3_ = new CStrikeArtillery(!!_loc2_.mMouse.mClickThing ? _loc2_.mMouse.mClickThing : _loc2_.mMouse.mClickPosition),0,false);
  277.          if(true)
  278.          {
  279.             if(_loc2_.mMouse.mClickThing)
  280.             {
  281.                if(true)
  282.                {
  283.                   _loc2_.AddTarget(_loc2_.mMouse.mClickThing,_loc3_);
  284.                }
  285.                _loc2_.mMouse.mClickThing.SelectionFlash_Init();
  286.             }
  287.          }
  288.       }
  289.       
  290.       public function InitPanel_Unit(param1:CHUDPanel) : void
  291.       {
  292.       }
  293.       
  294.       public function e_RDCOMPLETE_TOMAHAWK(param1:Event = null) : void
  295.       {
  296.          ActivateRDIcon(CHUDIcon(param1.currentTarget),"strikes",["tomahawkmissile"]);
  297.       }
  298.       
  299.       private function ActivateRDIcon(param1:CHUDIcon, param2:String, param3:Array) : void
  300.       {
  301.          var _loc4_:CHUD = null;
  302.          var _loc5_:String = null;
  303.          _loc4_ = param1.mHUD;
  304.          for each(_loc5_ in param3)
  305.          {
  306.             if(true)
  307.             {
  308.                _loc4_.GetPanel(param2).GetIcon(_loc5_).MakeAvailable();
  309.             }
  310.          }
  311.          if(true)
  312.          {
  313.             param1.Dispose();
  314.          }
  315.       }
  316.       
  317.       public function e_RDCOMPLETE_CHINOOK(param1:Event = null) : void
  318.       {
  319.          ActivateRDIcon(CHUDIcon(param1.currentTarget),"units",["chinooktroop","chinooktank"]);
  320.       }
  321.    }
  322. }
  323.